#include <cstdio>
#include <cstdlib>

int solve_ring_theft(int *house,int n)
{
    // 起始元素直接返回
    if (n == 0)     return 0;
    if (n == 1)     return house[0];
    if (n == 2)     return house[0]>house[1]?house[0]:house[1];

    // 开辟内存空间
    int* arr = (int*)malloc(n*sizeof(int));
    arr[0] = house[0];
    arr[1] = house[0]>house[1]?house[0]:house[1];
    
    // 必须要想个办法
}
int main()
{
    int arr[5] = {2,8,1,4,3};
    
    printf("%d\n",solve_ring_theft(arr,5));

    return 0;
}